//
//  AddShopTableViewCell3.m
//  GetPowerDBO
//
//  Created by 周博 on 2017/6/14.
//  Copyright © 2017年 BogoZhou. All rights reserved.
//

#import "AddShopTableViewCell3.h"
#import "AddShopViewController.h"
#import "JumpChooseViewController.h"
#import "ChooseCityViewController.h"
#import "LocalMapViewController.h"
#import "PickerViewController.h"


@interface AddShopTableViewCell3 ()
{
    NSInteger _buttonTag;

}
@property (nonatomic,strong) UIView *bigView;

@property (nonatomic,strong) UIView *topView;

@property (nonatomic,strong) UIView *centerView;

@property (nonatomic,strong) UIView *bottomView;

@property (nonatomic,strong) UIButton *bottomButton;
@end

@implementation AddShopTableViewCell3

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (IBAction)nomalButtonClick:(UIButton *)sender {
    NSIndexPath *indexPath = [[(AddShopViewController *)[self viewController] tableView] indexPathForCell:self];
    NSString *stirng = [NSString stringWithFormat:@"点击了%ld",indexPath.row];
//    kAlert(stirng);

    UIStoryboard *storyboard = kMainStroyboard;
    
    if (indexPath.row == 2) {//选择场所
        JumpChooseViewController *jumpVC = [storyboard instantiateViewControllerWithIdentifier:@"JumpChooseViewController"];
        jumpVC.modalPresentationStyle = UIModalPresentationOverFullScreen;
        jumpVC.indexPath = indexPath;
        [[self viewController] presentViewController:jumpVC animated:YES completion:nil];
    }else if (indexPath.row == 3){//店铺来源
        PickerViewController *pickerView = [storyboard instantiateViewControllerWithIdentifier:@"PickerViewController"];
        pickerView.dataArray = @[@"自谈",@"第三方合作"];
        pickerView.type = @"2";
        pickerView.indexpath = indexPath;
        pickerView.modalPresentationStyle = UIModalPresentationOverFullScreen;
        [[self viewController] presentViewController:pickerView animated:YES completion:nil];
    }else if (indexPath.row == 6){//选择省市
        ChooseCityViewController *chooseCityVC = [[ChooseCityViewController alloc] init];
        chooseCityVC.modalPresentationStyle =UIModalPresentationOverFullScreen;
        chooseCityVC.indexPath = indexPath;
        [[self viewController] presentViewController:chooseCityVC animated:YES completion:nil];
    }else if (indexPath.row == 7){//选择位置
        LocalMapViewController *mapView = [storyboard instantiateViewControllerWithIdentifier:@"LocalMapViewController"];
        mapView.indexPath = indexPath;
        [[self viewController] presentViewController:mapView animated:YES completion:nil];
    }
}



- (UIViewController *)viewController {
    UIResponder *next = self.nextResponder;
    do {
        //判断响应者是否为视图控制器
        if ([next isKindOfClass:[UIViewController class]]) {
            return (UIViewController *)next;
        }
        next = next.nextResponder;
    } while (next != nil);
    
    return nil;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
